<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Ext.Panel</title>
    <link rel="stylesheet" type="text/css" href="../lib/ext/resources/css/ext-all-neptune.css"/>
    <script type="text/javascript" src="../lib/ext/ext-all.js"></script>
    <script type="text/javascript" src="../lib/gf/common_grid.js"></script>
</head>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});

Ext.Loader.setPath('Ext.ux', '/ext4/ux/');
Ext.require([
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.toolbar.Paging',
    'Ext.ModelManager',
    'Ext.tip.QuickTipManager'
]);
var win, searchForm;
Ext.onReady(function () {
    Ext.define( 'OrderList', {
        extend: 'Ext.data.Model',
        fields: [
            '_id','order_list.branch_no','order_list.branch_name','order_list.linkman','order_list.tel','order_list.pre_date'
        ],
        idProperty: '_id'
    });

    var _urlparams = Ext.urlDecode(document.URL.split("?")[document.URL.split("?").length - 1]);
    // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        model: 'OrderList',
        proxy: {
            type: 'ajax',
            url: '/pre_meeting/order/list?_id=' + _urlparams._id,
            reader: {
                type: 'json'
            }
        }
    });

    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        loadMask: true,
        region: 'center',
        selModel: Ext.create('Ext.selection.CheckboxModel'),
        columns: [
            {text: '营业部编号',dataIndex: 'order_list.branch_no'},
            {text: '营业部名称',dataIndex: 'order_list.branch_name'},
            {text: '联系人',dataIndex: 'order_list.linkman'},
            {text: '联系电话',dataIndex: 'order_list.tel'},
            {text: '预约时间',dataIndex: 'order_list.pre_date'}
        ]
    });

    var viewport = new Ext.Viewport({
                layout: 'border',
                renderTo: "topic-grid",
                items: [searchForm,grid]}
    );
    store.load();
});
</script>
<body>
<div id="topic-grid" style="height: 1024px;width:100%"></div>
<p>The js is not minified so it is readable. See <a href="panel.js">panel.js</a>.</p>
</body>
</html>